import Cookies from 'js-cookie';

const userInfoName = 'business_user_info123123';

const setUserInfo = (userInfo: any) => {
  if (userInfo != null) Cookies.set(userInfoName, JSON.stringify(userInfo));
};

const getUserInfo = () => {
  return JSON.parse(Cookies.get(userInfoName) || '{}');
};

const removeUserInfo = () => {
  Cookies.remove(userInfoName);
};

export default {
  setUserInfo,
  getUserInfo,
  removeUserInfo,
};
